<!--  -->
<template>
  <div>
    <div class="position">
      <span class="position__icon iconfont">&#xf0ef;</span>
      陕西省西安市雁塔区丈八路221号雁塔区丈八路221号雁塔区丈八路221号
      <span class="position__bell iconfont">&#xe628;</span>
    </div>
    <!-- S search -->
    <div class="search">
      <span class="iconfont">&#xe627;</span>
      <div class="search__input">
        <input placeholder="请输入要搜索的商品"
               type="text">
      </div>
    </div>
    <!-- E search -->
    <!-- S banner -->
    <div class="banner">
      <img :src="banner"
           alt="">
    </div>
    <!-- E banner -->
    <!-- S 菜单 -->
    <div class="wrapper__menu">
      <div v-for="(item, index) in menuList"
           :key="index">
        <img :src="item.img"
             alt=""
             v-show="item.img">
        <p><span>{{ item.name }}</span></p>
      </div>
    </div>
    <!-- E 菜单 -->
  </div>
</template>

<script>
export default {
  name: 'StaticBanner',
  data () {
    return {
      banner: 'https://t7.baidu.com/it/u=737555197,308540855&fm=193&f=GIF',
      menuList: [
        { img: 'https://img3.sycdn.imooc.com/5e4a3ec90001ef8d04000400-140-140.jpg', name: '超市便利' },
        { img: 'https://img1.sycdn.imooc.com/5fd0fa270001ff0502610261-140-140.jpg', name: '菜市场' },
        { img: 'https://img1.sycdn.imooc.com/5f645ee90001171305440558-140-140.jpg', name: '水果店' },
        { img: 'https://img1.sycdn.imooc.com/5f2e6fea000152a305000500-140-140.jpg', name: '鲜花绿植' },
        { img: 'https://img1.sycdn.imooc.com/5f1e7dc1000152f304400440-140-140.jpg', name: '医疗健康' },
        { img: 'https://img3.sycdn.imooc.com/5458620000018a2602200220-140-140.jpg', name: '超市便利' },
        { img: 'https://img3.sycdn.imooc.com/5c36c432000158e609600960-160-160.jpg', name: '超市便利' },
        { img: 'https://img1.sycdn.imooc.com/54dc328d0001b75e04630463-140-140.jpg', name: '超市便利' },
        { img: 'https://img3.sycdn.imooc.com/5458620000018a2602200220-140-140.jpg', name: '超市便利' },
        { img: 'https://img3.sycdn.imooc.com/5458620000018a2602200220-140-140.jpg', name: '超市便利' }]
    }
  }
}
</script>

<style lang='scss'>
@import "../../style/variable.scss";
@import "../../style/mixin.scss";
.position {
  justify-content: space-between;
  margin-top: 0.12rem;
  position: relative;
  font-size: 0.14rem;
  color: $content-fontcolor;
  padding-right: 0.2rem;
  @include ellipsis;
  .position__icon {
    width: 0.16rem;
    height: 0.16rem;
    display: inline-block;
    top: 0.01rem;
    position: relative;
  }
  .position__bell {
    width: 0.16rem;
    height: 0.16rem;
    top: 0.02rem;
    right: 0;
    display: inline-block;
    position: absolute;
  }
}
.search {
  margin-top: 0.1rem;
  position: relative;
  span {
    position: absolute;
    left: 0.1rem;
    top: 0.06rem;
  }
  .search__input {
    width: 100%;
    input {
      background-color: #f1f1f1c7;
      border: none;
      padding: 0.1rem 0.4rem;
      width: 100%;
      box-sizing: border-box;
      border-radius: 1rem;
      outline: none;
    }
  }
}
.banner {
  background-color: chocolate;
  margin-top: 0.15rem;
  border-radius: 0.05rem;
  overflow: hidden;
  height: 1.3rem;
  img {
    width: 100%;
  }
}
.wrapper__menu {
  display: flex;
  flex-wrap: wrap;
  margin-top: 0.15rem;
  div {
    width: 20%;
    text-align: center;
    margin-top: 0.12rem;
    p {
      margin-top: 0.12rem;
    }
    img {
      background-color: orange;
      width: 0.4rem;
      height: 0.4rem;
      border-radius: 1rem;
    }
  }
}
</style>
